package akbderby.model;

import java.io.Serializable;

import javax.jdo.annotations.NotPersistent;
import javax.jdo.annotations.Persistent;

import org.slim3.datastore.Attribute;
import org.slim3.datastore.Model;

import com.google.appengine.api.datastore.Key;

@Model(schemaVersion = 1)
public class Blobstore implements Serializable {

    private static final long serialVersionUID = 1L;

    @Attribute(primaryKey = true)
    private Key key;

    @Persistent
    private Key imageKey;

    @Persistent
    private Long imageVersion;

    @Persistent
    private int count = 0;

    @Persistent
    private String myName;

    @Persistent
    private String group;

    @Persistent
    private String team;

    @Persistent
    private String nicName;

    @Persistent
    private String comeFrom;

    @Persistent
    private int age;

    @Persistent
    private String bloodType;

    @Persistent
    private int bust;

    @Persistent
    private int waist;

    @Persistent
    private int hip;

    @Persistent
    private String wikiUrl;

    @Persistent
    private String ekeUrl;

    @NotPersistent
    private String freeWord;

    @NotPersistent
    private boolean finished = false;

    @NotPersistent
    private int rank = 0;

    @NotPersistent
    private int click = 0;

    @NotPersistent
    private int point = 0;

    public String getMyName() {
        return myName;
    }

    public void setMyName(String myName) {
        this.myName = myName;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getGroup() {
        return group;
    }

    public String getTeam() {
        return team;
    }

    public void setTeam(String team) {
        this.team = team;
    }

    public String getNicName() {
        return nicName;
    }

    public void setNicName(String nicName) {
        this.nicName = nicName;
    }

    public String getComeFrom() {
        return comeFrom;
    }

    public void setComeFrom(String comeFrom) {
        this.comeFrom = comeFrom;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getBloodType() {
        return bloodType;
    }

    public void setBloodType(String bloodType) {
        this.bloodType = bloodType;
    }

    public int getBust() {
        return bust;
    }

    public void setBust(int bust) {
        this.bust = bust;
    }

    public int getWaist() {
        return waist;
    }

    public void setWaist(int waist) {
        this.waist = waist;
    }

    public int getHip() {
        return hip;
    }

    public void setHip(int hip) {
        this.hip = hip;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public Long getImageVersion() {
        return imageVersion;
    }

    public void setImageVersion(Long imageVersion) {
        this.imageVersion = imageVersion;
    }

    public Key getImageKey() {
        return imageKey;
    }

    public void setImageKey(Key imageKey) {
        this.imageKey = imageKey;
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getEkeUrl() {
        return ekeUrl;
    }

    public void setEkeUrl(String ekeUrl) {
        this.ekeUrl = ekeUrl;
    }

    public boolean isFinished() {
        return finished;
    }

    public void setFinished(boolean finished) {
        this.finished = finished;
    }

    public int getClick() {
        return click;
    }

    public void setClick(int click) {
        this.click = click;
    }

    public int getPoint() {
        return point;
    }

    public void setPoint(int point) {
        this.point = point;
    }

    public String getFreeWord() {
        this.freeWord =
            getMyName()
                + " "
                + getNicName()
                + " "
                + getComeFrom()
                + " "
                + getAge();
        return freeWord;
    }

    public void setFreeWord(String freeWord) {
        this.freeWord = freeWord;
    }

    public String getWikiUrl() {
        return wikiUrl;
    }

    public void setWikiUrl(String wikiUrl) {
        this.wikiUrl = wikiUrl;
    }

    /**
     * Returns the key.
     * 
     * @return the key
     */
    public Key getKey() {
        return key;
    }

    /**
     * Sets the key.
     * 
     * @param key
     *            the key
     */
    public void setKey(Key key) {
        this.key = key;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((key == null) ? 0 : key.hashCode());
        return result;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        Blobstore other = (Blobstore) obj;
        if (key == null) {
            if (other.key != null) {
                return false;
            }
        } else if (!key.equals(other.key)) {
            return false;
        }
        return true;
    }
}
